<table cellpadding="0" cellspacing="1" width="100%" bgcolor="#D3E1F1">
    <tr>
        <td width="80%" class="rongbay-form-title">
            <h1><a href="manage_promotion_hotel.html">QUẢN LÝ KHUYẾN MÃI KHÁCH SẠN</a> {if $can_add}[ <a
                    href="manage_promotion_hotel.html?cmd=add&amp;href={$href}">Thêm mới</a> ]{/if} </h1>
        </td>
        <td width="6%" class="form_title_button"></td>
    </tr>
</table>

{if $is_admin}
<table width="100%" cellspacing="0" cellpadding="5" border="1" bgcolor="#D3E1F1" style="border-collapse:collapse"
       bordercolor="#999999">

    <tr>
        <td align="right" nowrap="nowrap"><strong>Tên khách sạn:</strong></td>
        <td align="left" nowrap="nowrap">
            <input type="text" id="hotel_name" name="hotel_name"
                   value="{$hotel_name}" style="width:200px"/></td>
    </tr>
    <tr>
        <td align="right">&nbsp;</td>
        <td colspan="5" align="left"><input type="submit" value="Tìm kiếm"/></td>
    </tr>
</table>
{/if}
<div align="center">
{$message}
</div>

<p style="float:right">{$paging}</p>

<table width="99%" bordercolor="#CCCCCC" border="1" cellspacing="0" cellpadding="2"
       style="border-collapse:collapse;margin: 20px auto">
{if $promotion_hotels}
    {if $can_delete || $can_add}
        <tr>
            <td colspan="15" align="right" class="p10">
                <div class="fl">{if ($can_delete)}
                    [ <a href="javascript:void(0);"
                         onclick="selectAllCheckbox(document.ManagePromotionHotelForm,'ManagePromotionHotelForm',true,'#FFFFEC','white');">Chọn
                        tất cả</a> ]
                    [ <a href="javascript:void(0);"
                         onclick="selectAllCheckbox(document.ManagePromotionHotelForm,'ManagePromotionHotelForm',false,'#FFFFEC','white');">Bỏ
                        chọn</a> ]
                    [ <a href="javascript:void(0);"
                         onclick="selectAllCheckbox(document.ManagePromotionHotelForm,'ManagePromotionHotelForm',-1,'#FFFFEC','white');">Chọn
                        ngược lại</a> ]
                {/if}</div>
                <div class="c"></div>
            </td>
        </tr>
    {/if}
    <tr bgcolor="#EFEFEF">
        {if $can_delete}
            <th width="2%" title="check_all">
                <input type="checkbox" value="1" id="ManageHotelForm_all_checkbox"
                       onclick="selectAllCheckbox(this.form, 'ManageHotelForm',this.checked,'#FFFFEC','white');"/>
            </th>
        {/if}

        <th width="3%">Id</th>
        <th width="10%">Khách Sạn</th>
        <th width="20%">Loại KM</th>
        <th width="20%">Áp dụng cho</th>
        <th width="10%">Giá</th>
        <th width="3%">%</th>
        <th width="3%">Bắt đầu</th>
        <th width="3%">kết thúc</th>
        <th width="5%">Status</th>
        {if $can_delete || $admin_some_hotel}
            <th width="6%" align="left">
                {if $can_delete}
                    [ <a href="javascript:;" onclick="del_PromotionHotel_hotels_selected()">Xóa</a> ]
                {/if}
            </th>
        {/if}
    </tr>

    {foreach from=$promotion_hotels key=k item=promotion_hotel}
        <tr {if $promotion_hotel.out_of_date == 0}bgcolor="#f0f0f0" {else}style="color: gray;" {/if}
            id="sys_tr_hote_id_{$promotion_hotel.id}">
            {if ($can_delete)}
                <td align="center"><input class="sys_checkbox_id_PromotionHotel" name="selected_ids[]" type="checkbox"
                                          value="{$promotion_hotel.id}"
                                          onclick="select_checkbox(this.form,'ManagePromotionHotelForm',this,'#FFFFEC','white');"/>
                </td>
            {/if}
            <td align="center">{$promotion_hotel.id}</td>
            <td>{$promotion_hotel.name_hotel}</td>
            <td>{$promotion_hotel.name_type}</td>
            <td>{$promotion_hotel.name_room}</td>
            <td>{$promotion_hotel.price|price_format}</td>
            <td>{$promotion_hotel.percent}</td>
            <td>{$promotion_hotel.time_start}</td>
            <td>{$promotion_hotel.time_end}</td>
            <td nowrap="nowrap">
                {if $promotion_hotel.out_of_date == 0}
                    {if $promotion_hotel.status==1}<font color="#0066FF">Hiện</font>
                        {if $can_edit}
                            [<a href="manage_promotion_hotel.html?cmd=hide&id={$promotion_hotel.id}&href={$href}">Ẩn</a>]
                        {/if}
                    {/if}
                    {if $promotion_hotel.status==2}<font color="#FF6600">Đang ẩn</font>
                        {if $can_edit}
                            [<a href="manage_promotion_hotel.html?cmd=show&id={$promotion_hotel.id}&href={$href}">Hiện</a>]
                        {/if}
                    {/if}
                    {else}Hết hạn <br>
                {/if}
                {if $promotion_hotel.status==-1}<font color="#FF0000">Đã xóa</font>
                    {if $can_edit}
                        [<a href="manage_promotion_hotel.html?cmd=restore&id={$promotion_hotel.id}&href={$href}">Khôi
                        phục</a>]
                    {/if}
                {/if}
            </td>
            {if $can_delete || $admin_some_hotel}
                <td nowrap="nowrap">
                    {if $can_delete}[ <a
                            href="manage_promotion_hotel.html?cmd=delete&id={$promotion_hotel.id}&href={$href}"
                            onclick="return confirm('Bạn có chắc chắn muốn xóa không?');">Xóa</a> ]{/if}
                    {if $can_edit}[ <a
                            href="manage_promotion_hotel.html?cmd=edit&id={$promotion_hotel.id}&href={$href}">Sửa</a>
                        ]{/if}
                </td>
            {/if}


        </tr>
    {/foreach}
    {else}
    <tr>
        <td colspan="15" align="right" class="p10">
            <strong>Không tìm thấy khách sạn nào!</strong>
        </td>
    </tr>
{/if}
</table>

<p style="float:right">{$paging}</p>